
local g=1
use "C:\Users\mcsam\Dropbox\Decomposing Firm Betas\Submissions\JPE Macro\Replication Folder\Table_A3_data",replace
foreach var of varlist chshare* ls{
	sum `var' 
	local m=`r(mean)'*12
	local sd=`r(sd)'*sqrt(12)
	local sharpe=`m'/`sd'	
	reg `var' mktrf,r

	predict fit,xb
	sum fit
	local syssd=`r(sd)'
	predict resid,r
	sum resid
	local idiosd=`r(sd)'
	drop fit resid

	reg `var' mktrf,r
	if `g'==1{
		outreg2 using test, replace addstat("mean",`m',"sd",`sd',"sharpe",`sharpe')
		local g=2
	}
	else{
		outreg2 using test, append addstat("mean",`m',"sd",`sd',"sharpe",`sharpe')
	}
}
